package com.zyong.design.pattern.command.case2;

/**
 * @program: zyong-design-pattern
 * @ClassName: TelevisionOffCommand
 * @author: zyong
 * @create: 2024-03-27 22:05
 */
public class TelevisionOffCommand implements Command {
    private TelevisionReceiver televisionReceiver;

    public TelevisionOffCommand(TelevisionReceiver televisionReceiver) {
        this.televisionReceiver = televisionReceiver;
    }

    @Override
    public void execute() {
        televisionReceiver.off();
    }

    @Override
    public void undo() {
        televisionReceiver.on();
    }
}
